function main() { extract($_REQUEST); $send=$_REQUEST['send']; $t=$_REQUEST['type']; $type=$send; if($Submit=='Upload') { if(empty($_SESSION['letters_code'] ) || strcasecmp($_SESSION['letters_code'], $_POST['letters_code']) != 0) { //Note: the captcha code is compared case insensitively. //if you want case sensitive match, update the check above to // strcmp() $errors .= "\n The Security code does not match!!!"; } if(empty($errors)) { $Addeddate=date('Y-m-d h:i:s',time()); // to upload main image in folder and image path in table $filename1 = $_FILES['image']['name']; $filesize1 = $_FILES['image']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path = "exhibition-images/".$path1; $up_path = "exhibition-images/".$path1; copy($_FILES['image']['tmp_name'],$image_path); chmod($image_path,0777); } } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image1']['name']; $filesize1 = $_FILES['image1']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path1 = "exhibition-images/".$path1; $up_path1 = "exhibition-images/".$path1; copy($_FILES['image1']['tmp_name'],$image_path1); chmod($image_path1,0777); } $first_img=$up_path1.'~'.$title1; } // image upload ends // to upload 1st image in folder and image path in table //$s1=array(); $filename1 = $_FILES['image2']['name']; $filesize1 = $_FILES['image2']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path2 = "exhibition-images/".$path1; $up_path2 = "exhibition-images/".$path1; copy($_FILES['image2']['tmp_name'],$image_path2); chmod($image_path1,0777); } $second_img=$up_path2.'~'.$title2; } $filename1 = $_FILES['image3']['name']; $filesize1 = $_FILES['image3']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path3 = "exhibition-images/".$path1; $up_path3 = "exhibition-images/".$path1; copy($_FILES['image3']['tmp_name'],$image_path3); chmod($image_path3,0777); } $third_img=$up_path3.'~'.$title3; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image4']['name']; $filesize1 = $_FILES['image4']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path4 = "exhibition-images/".$path1; $up_path4 = "exhibition-images/".$path1; copy($_FILES['image4']['tmp_name'],$image_path4); chmod($image_path2,0777); } $fourth_img=$up_path4.'~'.$title4; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image5']['name']; $filesize1 = $_FILES['image5']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path5 = "exhibition-images/".$path1; $up_path5 = "exhibition-images/".$path1; copy($_FILES['image5']['tmp_name'],$image_path5); chmod($image_path5,0777); } $fifth_img=$up_path5.'~'.$title5; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image6']['name']; $filesize1 = $_FILES['image6']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path6 = "exhibition-images/".$path1; $up_path6 = "exhibition-images/".$path1; copy($_FILES['image6']['tmp_name'],$image_path6); chmod($image_path6,0777); } $sixth_img=$up_path6.'~'.$title6; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image7']['name']; $filesize1 = $_FILES['image7']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path7 = "exhibition-images/".$path1; $up_path7 = "exhibition-images/".$path1; copy($_FILES['image7']['tmp_name'],$image_path7); chmod($image_path7,0777); } $seventh_img=$up_path7.'~'.$title7; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image8']['name']; $filesize1 = $_FILES['image8']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path8 = "exhibition-images/".$path1; $up_path8 = "exhibition-images/".$path1; copy($_FILES['image8']['tmp_name'],$image_path8); chmod($image_path8,0777); } $eighth_img=$up_path8.'~'.$title8; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image9']['name']; $filesize1 = $_FILES['image9']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size9 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path9 = "exhibition-images/".$path1; $up_path9 = "exhibition-images/".$path1; copy($_FILES['image9']['tmp_name'],$image_path9); chmod($image_path1,0777); } $ninenth_img=$up_path9.'~'.$title9; } // image upload ends // to upload 1st image in folder and image path in table $filename1 = $_FILES['image10']['name']; $filesize1 = $_FILES['image10']['size']; $ext1 = strtolower(substr(strrchr($filename1, "."), 1)); $image_size1 = ($filesize1 / 1024); if($filename1 != '') { if($ext1 == 'jpg' or $ext1 == 'jpeg' or $ext1 == 'gif' or $ext1 == 'png') { $path1 = $txtcity.'_'.time().'_'.str_replace(" ","_",$filename1); $image_path10 = "exhibition-images/".$path1; $up_path10 = "exhibition-images/".$path1; copy($_FILES['image10']['tmp_name'],$image_path10); chmod($image_path10,0777); } $tenth_img=$up_path10.'~'.$title10; } // image upload ends //inserting added values to boutique table $boutique_add=mysql_query("insert into `exhibitionidea` (`ex_id`,`main_type`,`type`,`name`,`class`,`medium_used`,`school`,`contact`,`email`,`video`,`main_image`,`main_image_caption`,`title`,`image1`, `image2` , `image3` , `image4` , `image5` , `image6` , `image7` , `image8` , `image9` , `image10` , `status` , `get_date` ,`approved_date`) values ('' ,'$main_type' ,'$type','$name' , '$class', '$medium_used' , '$school','$contact' , '$email' ,'$url' , '$up_path','$description' ,'$title', '$first_img' , '$second_img' ,'$third_img' ,'$fourth_img' ,'$fifth_img' ,'$sixth_img' ,'$seventh_img' ,'$eighth_img' ,'$ninenth_img' ,'$tenth_img' ,'I' , '$Addeddate' , '')"); if($boutique_add) { ?> } else echo "Cant add details.Try again."; } else { ?> } } ?>
Home » Idearoom » » Idearoom Image Upload |